using Microsoft.Xna.Framework;

namespace WODPL.Models
{
    public class CharacterModel
    {
        private Vector3 origin = new Vector3(0,0,0);
        private Vector3 targetOrigin = new Vector3(0,0,0);

        public void MoveCharacterTo(Vector3 target)
        {
            targetOrigin = target;
        }

        public Vector3 Origin
        {
            get { return origin; }
        } 

        public void Update(GameTime time)
        {
            var dir = targetOrigin - origin;
            if (dir.Length() < 1E-5)
            {
                return;
            }
            dir.Normalize();
            origin += Vector3.Multiply(dir,(float) (time.ElapsedGameTime.TotalSeconds*15));
        }
    }
}